<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root"></div>
    <script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
    <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
    <script type="text/babel">

        let random = function(num){
            return parseInt(Math.random() * num);
        }
        let Card = function(props){
            let style = {
                width:"150px",
                height:"150px",
                backgroundColor:`rgb(${random(256)},${random(256)},${random(256)})`,
                color:`rgb(${random(256)},${random(256)},${random(256)})`
            };
            return <div style={style}>
                {props.children}
            </div>
        }
        let Parent = function(){
            let letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U"];
            return <div>
                <h1>字母卡片</h1>
                {letters.map(item => <Card>{item}</Card>)}
            </div>
        }
        ReactDOM.createRoot(document.getElementById("root")).render(<Parent />);
    </script>
</body>
</html>